"""
This class basically keeps track of the mouse, needs to be able to keep track of buttons held for a period of time too
possibly just add a New Click variable on first down and clear it on next setPos()
"""
class mouse_c:
    #setup pos and 10 buttons, if that aint enough you can kiss my ring. Or write some mouse button detection code, whatever.
    def __init__(self):
        self.pos = (0,0)
        self.size = (32,32)
        self.buttons = [0,0,0,0,0,0,0,0,0,0]
        self.buttonDown = False
        self.area = [0,0,0,0]
    def getPos(self):
        return self.pos
    def setPos(self, pos):
        self.area = pos[0]-self.size[0]/2, pos[1]-self.size[1]/2, self.size[0], self.size[1]
        self.pos = pos
    def setButton(self, buttonNo, state):
        self.buttons[buttonNo] = state
        self.checkButtons()
    def getButton(self, buttonNo):
        return self.buttons[buttonNo]
    def checkButtons(self):
        i=0
        buttonSet = False
        while i < len(self.buttons) and buttonSet != True:
            if self.buttons[i] != 0:
                buttonSet = True
            i += 1
        self.buttonDown = buttonSet
        
class mouseArea1:
    def __init__(self, x, y, width, height, funcToCall):
        self.x = x
        self.y = y
        self.width = width
        self.height = height
        self.funcToCall = funcToCall

    #should just pass in the mouse object
    def checkArea(self, pos):
        if pos[0] >= self.x and pos[0] <= self.x + self.width and pos[1] >= self.y and pos[1] <= self.y + self.height:
            #call the func, this way the object doesn't need to know where on the screen it is
            self.funcToCall(pos[0] - self.x, pos[1] - self.y)